package com.cjc.example;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;

import com.cjc.ban.Bean;
import com.cjc.ban.lstVideoInfo;
import com.cjc.mAsyTack.MyAsyncTask;
import com.cjc.mAsyTack.OnGetJsonResultListener;
import com.cjc.tools.Constants;

public class MainActivity extends Activity implements OnGetJsonResultListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		// http://171.221.223.206:8182/SysService.svc/videos
		String method = "videos";
		new MyAsyncTask<Object>(this,Bean[].class.getName()).execute(method, null, Constants.GET_JSON);//
	}

	@Override
	public <T> void getJsonResult(T t) {
		// TODO Auto-generated method stub
		Bean[] map=(Bean[]) t;
		System.out.println("这是长度："+map.length);
		for (int i = 0; i < map.length; i++) {
			System.out.println("	" + map[i].BaseName);
			System.out.println("	" + map[i].BaseID);
			System.out.println("	" + map[i].BaseVideoCount);
			List<lstVideoInfo> map2 = map[i].lstVideoInfos;
			for (int j = 0; j < map2.size(); j++) {
				System.out.println("		" + map2.get(j).videoDesc);
				System.out.println("		" + map2.get(j).videoIP);
				System.out.println("		" + map2.get(j).videoPort);
				System.out.println("		" + map2.get(j).videoPwd);
				System.out.println("		" + map2.get(j).videoType);
				System.out.println("		" + map2.get(j).videoUserName);
			}
		}
	}

}
